/***************************************************************************
 *   Copyright (C) 2007 by Sebastian Bilski, Lance Cooper, Jeff Rebacz,
 *   									and Alex Zelenskiy
 *   sbilski@iit.edu
 *   lance.m.cooper@gmail.com
 *   jeff.rebacz@gmail.com
 *   voiceofanarchy@gmail.com
 *
 *	This file is part of connect3
 *
 *   connect3 is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License, version 2,
 *    as published by the Free Software Foundation
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the
 *   Free Software Foundation, Inc., 
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
 ***************************************************************************/

import java.awt.Color;
import java.util.ArrayList;


public class Player {
	public String userName;
	//icon
	public boolean isReadyToStart;
	public int turnOrder;
	public ArrayList<GamePiece> pieces;
	public Color color;	
	
	public Player() {
		super();
		pieces = new ArrayList<GamePiece>();
		color=Color.RED;
		turnOrder=0;
	}
	public Player(String userName, Color color) {
		super();
		pieces = new ArrayList<GamePiece>();
		this.userName = userName;
		this.color = color;
		turnOrder=0;
	}
	
	public GamePiece generatePiece(){
		GamePiece gp = new GamePiece();
		gp.setColor(color);
		gp.setP(this);
		pieces.add(gp);
		return gp;
	}
	
	public Color getColor() {
		return color;
	}
	
	public void setColor(Color color) {
		this.color = color;
	}
	
	public boolean isReadyToStart() {
		return isReadyToStart;
	}
	
	public void setReadyToStart(boolean isReadyToStart) {
		this.isReadyToStart = isReadyToStart;
	}
	
	public ArrayList<GamePiece> getPieces() {
		return pieces;
	}
	
	public void addPiece(GamePiece piece) {
		pieces.add(piece);
	}
	
	public int getTurnOrder() {
		return turnOrder;
	}
	
	public void setTurnOrder(int turnOrder) {
		if(turnOrder>=0){
			this.turnOrder = turnOrder;
		}else{
			turnOrder=0;
			System.err.println("invalid turn order");
		}
	}
	
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	
	public boolean isLocalPlayer()
	{
		return false;
	}
	
	public boolean isRemotePlayer()
	{
		return false;
	}
	
	public boolean isHostPlayer()
	{
		return false;
	}
}
